#
# For Qt
#
#find_package(Qt4 REQUIRED)

add_definitions(${QT_DEFINTIONS})

link_directories(${QT_LIB_DIR})

include_directories(${QT_INCLUDE_DIR})

include(${QT_USE_FILE})

set(improv_srcs
    CircularBuffer.cpp
    FileIO.cpp
    MidiFile.cpp
    MidiFileWrite.cpp
    MidiOutput.cpp
    MidiPerform.cpp
    SigTimer.cpp
)

if(WIN32)
    set(improv_platform_srcs
        MidiOutPort_visual.cpp
    )
else(WIN32)
    set(improv_platform_srcs
        MidiOutPort_alsa.cpp
        MidiOutPort_linux.cpp
        MidiOutPort_oss.cpp
        MidiOutPort_unsupported.cpp
        Sequencer_alsa.cpp
        Sequencer_alsa05.cpp
        Sequencer_alsa09.cpp
        Sequencer_oss.cpp
    )
endif(WIN32)

set(improv_libDirs
    .
)

set(improv_libs
    ${QT_LIBRARIES}
)

if (UNIX)
    include(../../audio-lib.txt)
endif(UNIX)

if(WIN32)
    set(improv_platform_libs
        WinMM
    )
else(WIN32)
    if(alsa)
        set(improv_platform_libs
                # ALSA
                asound
        )
    endif(alsa)
endif(WIN32)

include_directories(.)

if(WIN32)
    add_definitions(-DVISUAL)
else(WIN32)
    if(UNIX)
        add_definitions(-DLINUX)
        if(alsa)
            add_definitions(-DALSA)
        endif(alsa)
        if(oss)
            add_definitions(-DOSS)
        endif(oss)
    endif(UNIX)
endif(WIN32)

add_library(improv ${improv_srcs} ${improv_platform_srcs})

target_link_libraries(improv ${improv_libs} ${improv_platform_libs})

link_directories(${improv_libDirs})
